﻿using System.Web.Mvc;

namespace RHD.Common.Web.Utility.Extensions {
	public static class ViewDataExtension {

		public static void SetValue<T>(this ViewDataDictionary viewData, string key, T value) {
			viewData[key] = value;
		}

		public static T GetValue<T>(this ViewDataDictionary viewData, string key) {
			if (viewData[key] == null)
				return default(T);

			return (T)viewData[key];
		}
	}
}